package tools
{
	import entities.Entity;
	
	import flash.display.BitmapData;
	
	import org.flixel.FlxGroup;
	import org.flixel.plugin.photonstorm.FlxWeapon;

	public class MyFlxWeapon extends FlxWeapon
	{
		
		public var power:Number;
		
		public function MyFlxWeapon(name:String, parentRef:Entity = null, xVariable:String = "x", yVariable:String = "y", power:Number=1)
		{
			super(name, parentRef,xVariable,yVariable);
			
			this.power = power;
			
		}
		
		
		public function makeBitmapBullet(quantity:uint, image:BitmapData, frameWidth:uint, frameHeight:uint, frames:Array, offsetX:int = 0, offsetY:int = 0 ):void
		{
			group = new FlxGroup(quantity);
			for (var b:uint = 0; b < quantity; b++)
			{
				var tempBullet:MyBullet = new MyBullet(this, b, parent, power);
				tempBullet.loadGraphicWithBitmap(image, true, true,frameWidth,frameHeight);
				if(frames.length > 1)tempBullet.addAnimation("fire", frames, 10, true);
				tempBullet.height = frameHeight;
				group.add(tempBullet);
			}
			
			positionOffset.x = offsetX;
			positionOffset.y = offsetY;

		}
		
	}
}